#include "minunit.h"
#include <assert.h>
#include <string.h>
#include <lcthw/mystdio.h>
char *test1 = "test1 data";
char *test2 = "test2 data";
char *test3 = "test3 data";
int data1=1234;
int data2=2;
char buf1[80]="",buf2[80]="";
char* stradd(char* str)
{
    str++;
    printf("in func:%s\n",str);
    return str;
}
char *test_sprintf()
{
    mysprintf(buf1,">>> %s %s %s %d %d<<<\n",test1,test2,test3,data1,data2);
    sprintf(buf2,">>> %s %s %s %d %d<<<\n",test1,test2,test3,data1,data2);
    puts(buf1);
    mu_assert(strcmp(buf1,buf2)==0,"error!");

    mysprintf(buf1,">>> %d <<<\n",data1);
    sprintf(buf2,">>> %d <<<\n",data1);
    puts(buf1);
        puts(buf2);
    mu_assert(strcmp(buf1,buf2)==0,"error!");
    return NULL;
}

char *all_tests() {
    mu_suite_start();
    mu_run_test(test_sprintf);

 
    return NULL;
}

RUN_TESTS(all_tests);

// int main()
// {
//     // mysprintf(buf1,">>> %s<<<\n",test1);
//     // puts(buf1);
//     // sprintf(buf2,">>> %s<<<\n",test1);
//     // puts(buf2);
//     stradd(test1);
//     puts(test1);
//     puts(test1);   
// }
